#ifndef _COMMONRESOURCE_H
#define _COMMONRESOURCE_H

#include "ScreenManager.h"
#include "../input/KeyboardHandler.h"

/* CommonResource is singleton. From its routines, other classes can access variables
 * that might be of interest.
 */
class CommonResource {
public:
    /* Get and set the variable that controls whether the program should stop running */
    void setQuit(bool);
    bool getQuit();
    
    /* Get and set the active screen */
    void setActiveScreen(int);
    int getActiveScreen();
    
    /* Fetches the screen manager */
    ScreenManager* getScreenManager() const;
    void setScreenManager(ScreenManager*);

    void setKeyboardHandler(KeyboardHandler *);
    KeyboardHandler * getKeyboardHandler();

    /* CommonResource is singleton. This is used to get a pointer to the one instance */
    static CommonResource* getInstance();

private:
    bool mQuit;
    ScreenManager* mScreenManager;
    KeyboardHandler *mKeyboardHandler;
    int mActiveScreen;
    static CommonResource* mInstance; /* Singleton instance*/    

    /* some things declared private */
    CommonResource();
    CommonResource(const CommonResource &); //undefined
    CommonResource & operator=(const CommonResource &); //undefined


};


#endif

